// Copyright (C) <2018> Zealcomm Inc.
//
// SPDX-License-Identifier: Apache-2.0
#import <Foundation/Foundation.h>
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
@class IRTCP2PPublication;
RTC_EXPORT
@protocol IRTCP2PPublicationDelegate<NSObject>
@optional
/// Publication is ended.<br>发布结束。
- (void)publicationDidEnd:(IRTCP2PPublication*)publication;
@end
/**
  @brief Publication represents a sender for publishing a stream.<br>发布表示一个流发送者发布一条音视频流。
  @details It handles the actions on a LocalStream published to a remote endpoint.<br>它处理了将一条本地音视频流发布到一个视频会议的各个动作。
*/
RTC_EXPORT
@interface IRTCP2PPublication : NSObject
- (instancetype)init NS_UNAVAILABLE;
/// Stop certain publication. Once a subscription is stopped, it cannot be recovered.<br>停止某个发布。一旦某个发布被停止，它将不能被恢复。
- (void)stop;
/// Get stats of underlying PeerConnection.<br>获取当前PeerConnection的状态数据。
- (void)stats:(void (^)(NSArray<RTCLegacyStatsReport*>* stats))onSuccess
    onFailure:(nullable void (^)(NSError*))onFailure;
@property(nonatomic, weak) id<IRTCP2PPublicationDelegate> delegate;
@end
NS_ASSUME_NONNULL_END
